﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QTFS.ViewModels
{
    public class MusicListModel
    {
        public List<string> MusicList { get; set; } = new List<string>();

        public List<string> Extensions { get; set; } = new List<string>()
        {
            ".mp3",
            ".flac",
            ".wav",
            ".aac"
        };

        public string ListPath = "C:\\Users\\11748\\Music\\";

        public MusicListModel()
        {
            //加载文件夹
            var di = new DirectoryInfo(ListPath);
            var fileList = di.GetFiles().Where(x => Extensions.Contains(x.Extension)).ToList();
            fileList.ForEach(x => MusicList.Add(x.Name));
        }
    }
}
